
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Springboot一些遇到的问题 · My Study Note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="yanglonglong">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../vue/" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://www.yangllong.top/" target="_blank" class="custom-link">My Blog</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Linux相关/">
            
                <a href="../Linux相关/">
            
                    
                    Linux相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Linux相关/make工具的使用.html">
            
                <a href="../Linux相关/make工具的使用.html">
            
                    
                    Make工具的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    Springboot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1" data-path="springboot一些遇到的问题.html">
            
                <a href="springboot一些遇到的问题.html">
            
                    
                    Springboot一些遇到的问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../vue/">
            
                <a href="../vue/">
            
                    
                    Vue
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../vue/vue+ssm跨域问题.html">
            
                <a href="../vue/vue+ssm跨域问题.html">
            
                    
                    Vue+Ssm跨域问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../vue/vue-cli3.html">
            
                <a href="../vue/vue-cli3.html">
            
                    
                    Vue Cli3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../vue/安装vue.html">
            
                <a href="../vue/安装vue.html">
            
                    
                    安装Vue
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../其他/">
            
                <a href="../其他/">
            
                    
                    其他
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../其他/分布式系统.html">
            
                <a href="../其他/分布式系统.html">
            
                    
                    分布式系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../其他/图解http.html">
            
                <a href="../其他/图解http.html">
            
                    
                    图解Http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../其他/消息队列.html">
            
                <a href="../其他/消息队列.html">
            
                    
                    消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../其他/爬虫.html">
            
                <a href="../其他/爬虫.html">
            
                    
                    爬虫
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../刷题/">
            
                <a href="../刷题/">
            
                    
                    刷题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../刷题/NOJ.html">
            
                <a href="../刷题/NOJ.html">
            
                    
                    NOJ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../刷题/leetcode/">
            
                <a href="../刷题/leetcode/">
            
                    
                    Leetcode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../刷题/leetcode/107简单题.html">
            
                <a href="../刷题/leetcode/107简单题.html">
            
                    
                    107简单题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.3.1" data-path="../刷题/leetcode/2两数相加.html">
            
                <a href="../刷题/leetcode/2两数相加.html">
            
                    
                    2两数相加
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3.2" data-path="../刷题/leetcode/3无重复子串的最大长度.html">
            
                <a href="../刷题/leetcode/3无重复子串的最大长度.html">
            
                    
                    3无重复子串的最大长度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../刷题/扇贝杯csdn.html">
            
                <a href="../刷题/扇贝杯csdn.html">
            
                    
                    扇贝杯Csdn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../刷题/排序算法.html">
            
                <a href="../刷题/排序算法.html">
            
                    
                    排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../刷题/蓝桥杯.html">
            
                <a href="../刷题/蓝桥杯.html">
            
                    
                    蓝桥杯
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../刷题/蓝桥杯热身赛.html">
            
                <a href="../刷题/蓝桥杯热身赛.html">
            
                    
                    蓝桥杯热身赛
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../刷题/计算机等级考试(C语言">
            
                <span>
            
                    
                    计算机等级考试(C语言)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../博客/">
            
                <a href="../博客/">
            
                    
                    博客
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../博客/next主题配置.html">
            
                <a href="../博客/next主题配置.html">
            
                    
                    Next主题配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../博客/一些问题的记录.html">
            
                <a href="../博客/一些问题的记录.html">
            
                    
                    一些问题的记录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../学习java/">
            
                <a href="../学习java/">
            
                    
                    学习Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../学习java/AQS.html">
            
                <a href="../学习java/AQS.html">
            
                    
                    AQS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../学习java/HashMap的简单实现.html">
            
                <a href="../学习java/HashMap的简单实现.html">
            
                    
                    HashMap的简单实现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../学习java/JavaByteCode.html">
            
                <a href="../学习java/JavaByteCode.html">
            
                    
                    JavaByteCode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../学习java/Java基础.html">
            
                <a href="../学习java/Java基础.html">
            
                    
                    Java基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../学习java/Java多线程.html">
            
                <a href="../学习java/Java多线程.html">
            
                    
                    Java多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../学习java/Java多线程并发.html">
            
                <a href="../学习java/Java多线程并发.html">
            
                    
                    Java多线程并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../学习java/Java爬虫.html">
            
                <a href="../学习java/Java爬虫.html">
            
                    
                    Java爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../学习java/Java集合.html">
            
                <a href="../学习java/Java集合.html">
            
                    
                    Java集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../学习java/java常用类.html">
            
                <a href="../学习java/java常用类.html">
            
                    
                    Java常用类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../学习java/jvm.html">
            
                <a href="../学习java/jvm.html">
            
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.11" data-path="../学习java/noifelse.html">
            
                <a href="../学习java/noifelse.html">
            
                    
                    Noifelse
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.12" data-path="../学习java/socket.html">
            
                <a href="../学习java/socket.html">
            
                    
                    Socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.13" data-path="../学习java/一些Java方法.html">
            
                <a href="../学习java/一些Java方法.html">
            
                    
                    一些Java方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.14" data-path="../学习java/一些其他人写的博客.html">
            
                <a href="../学习java/一些其他人写的博客.html">
            
                    
                    一些其他人写的博客
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.15" data-path="../学习java/硬核空间.html">
            
                <a href="../学习java/硬核空间.html">
            
                    
                    硬核空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.16" data-path="../学习java/遇到的问题.html">
            
                <a href="../学习java/遇到的问题.html">
            
                    
                    遇到的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.17" data-path="../学习java/阻塞队列.html">
            
                <a href="../学习java/阻塞队列.html">
            
                    
                    阻塞队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../安卓开发/">
            
                <a href="../安卓开发/">
            
                    
                    安卓开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../安卓开发/First App.html">
            
                <a href="../安卓开发/First App.html">
            
                    
                    First App
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../安卓开发/problems.html">
            
                <a href="../安卓开发/problems.html">
            
                    
                    Problems
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../工具/">
            
                <a href="../工具/">
            
                    
                    工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../工具/IDEA.html">
            
                <a href="../工具/IDEA.html">
            
                    
                    IDEA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../工具/docker.html">
            
                <a href="../工具/docker.html">
            
                    
                    Docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../工具/github.html">
            
                <a href="../工具/github.html">
            
                    
                    Github
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../数据库/">
            
                <a href="../数据库/">
            
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../数据库/MVCC.html">
            
                <a href="../数据库/MVCC.html">
            
                    
                    MVCC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../数据库/MySQL.html">
            
                <a href="../数据库/MySQL.html">
            
                    
                    MySQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../数据库/Redis.html">
            
                <a href="../数据库/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../数据结构知识/">
            
                <a href="../数据结构知识/">
            
                    
                    数据结构知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../数据结构知识/大话数据结构笔记1.html">
            
                <a href="../数据结构知识/大话数据结构笔记1.html">
            
                    
                    大话数据结构笔记1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../数据结构知识/大话数据结构笔记2.html">
            
                <a href="../数据结构知识/大话数据结构笔记2.html">
            
                    
                    大话数据结构笔记2
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../面试笔试/">
            
                <a href="../面试笔试/">
            
                    
                    面试笔试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../面试笔试/字节跳动5月11日笔试.html">
            
                <a href="../面试笔试/字节跳动5月11日笔试.html">
            
                    
                    字节跳动5月11日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../面试笔试/阿里3月23日笔试.html">
            
                <a href="../面试笔试/阿里3月23日笔试.html">
            
                    
                    阿里3月23日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../面试笔试/面试突击.html">
            
                <a href="../面试笔试/面试突击.html">
            
                    
                    面试突击
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Springboot一些遇到的问题</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="springboot&#x542F;&#x52A8;&#x767D;&#x9875;whitelable-error-page&#x7684;&#x95EE;&#x9898;">springboot&#x542F;&#x52A8;&#x767D;&#x9875;(Whitelable Error Page)&#x7684;&#x95EE;&#x9898;</h3>
<p>&#x4F7F;&#x7528;SpringBoot&#x5199;HelloWorld&#xFF0C;&#x5F53;&#x914D;&#x7F6E;&#x597D;&#x542F;&#x52A8;&#x7C7B;&#x540E;&#xFF0C;&#x518D;&#x521B;&#x5EFA;&#x65B0;&#x7684;controller&#x6216;&#x5176;&#x5B83;&#x7C7B;&#xFF0C;&#x542F;&#x52A8;&#x9879;&#x76EE;&#x540E;&#x8BBF;&#x95EE;&#x5BF9;&#x5E94;&#x7684;&#x6620;&#x5C04;&#x540D;&#xFF0C;&#x9875;&#x9762;&#x663E;&#x793A;&#xFF1A;</p>
<p><strong>Whitelabel Error Page</strong></p>
<p><strong>This application has no explicit mapping for /error, so you are seeing this as a fallback.</strong></p>
<p>&#x6620;&#x5C04;&#x672A;&#x627E;&#x5230;&#xFF0C;&#x51FA;&#x73B0;&#x8FD9;&#x4E2A;&#x5F02;&#x5E38;&#x8BF4;&#x660E;&#x4E86;&#x8DF3;&#x8F6C;&#x9875;&#x9762;&#x7684;url&#x65E0;&#x5BF9;&#x5E94;&#x7684;&#x503C;.</p>
<p><strong>&#x89E3;&#x51B3;&#xFF1A;</strong></p>
<p>&#x6392;&#x67E5;&#x8FC7;&#x7A0B;&#xFF1A;</p>
<p>&#x3000;&#x3000;1&#x3001;&#x5148;&#x786E;&#x5B9A;URL&#x662F;&#x5426;&#x6B63;&#x786E;&#xFF08;&#x6B63;&#x786E;&#x65E0;&#x8BEF;&#xFF09;&#xFF1B;</p>
<p>&#x3000;&#x3000;2&#x3001;&#x7531;&#x4E8E;&#x4E4B;&#x524D;&#x81EA;&#x5DF1;&#x5199;&#x8FC7;&#xFF0C;&#x5E76;&#x4E14;&#x6210;&#x529F;&#x8BBF;&#x95EE;&#xFF0C;&#x4F46;&#x662F;&#x8FD9;&#x6B21;&#x6CA1;&#x6709;&#x6210;&#x529F;&#xFF0C;&#x6240;&#x4EE5;&#x8FDB;&#x884C;&#x6BD4;&#x8F83;&#xFF0C;&#x53D1;&#x73B0;&#x542F;&#x52A8;&#x7C7B;&#x7684;&#x4F4D;&#x7F6E;&#x4E0D;&#x540C;&#xFF0C;&#x4E0A;&#x7F51;&#x627E;&#x4E86;&#x627E;&#x8D44;&#x6599;&#xFF0C;&#x53D1;&#x73B0;SpringBoot&#x9ED8;&#x8BA4;&#x626B;&#x63CF;&#x7684;&#x8303;&#x56F4;&#x4E3A;&#x672C;&#x5305;&#x53CA;&#x5B50;&#x5305;&#xFF1A;</p>
<p>&#x3000;&#x3000;&#x3000;&#x3000;&#x8FDB;&#x5165;@SpringBootApplication&#x7684;&#x6E90;&#x7801;&#xFF1A;</p>
<p><img src="../img/1620" alt="img"></p>
<p>&#x3000;&#x3000;&#x3000;&#x3000;&#x800C;<strong>@ComponentScan&#x7684;&#x9ED8;&#x8BA4;&#x626B;&#x63CF;&#x8303;&#x56F4;&#x4E3A;&#x672C;&#x5305;&#x53CA;&#x5B50;&#x5305;</strong>&#xFF1B;</p>
<p>&#x6240;&#x4EE5;&#x53EA;&#x9700;&#x5C06;&#x8BBF;&#x95EE;&#x7684;Controller&#x7C7B;&#x653E;&#x5230;&#x542F;&#x52A8;&#x7C7B;&#x7684;&#x540C;&#x7EA7;&#x6216;&#x5B50;&#x7EA7;&#x7684;&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;&#xFF1B;</p>
<p>&#x6216;&#x8005;&#x5728;&#x542F;&#x52A8;&#x7C7B;&#x4E0A;&#x6307;&#x5B9A;@ComponentScan&#x7684;&#x8303;&#x56F4;&#x5C31;OK&#x4E86;&#xFF01;</p>
<h3 id="&#x914D;&#x7F6E;mybatis">&#x914D;&#x7F6E;mybatis</h3>
<h4 id="the-server-time-zone-value-&#xFFFD;&#x439;&#xFFFD;&#xFFFD;&#xFFFD;&#x5FC;&#x2B1;&#xFFFD;&#xFFFD;-is-unrecognized-or-represents-more-than-one-time-zone">The server time zone value &apos;&#xFFFD;&#x439;&#xFFFD;&#xFFFD;&#xFFFD;&#x5FC;&#x2B1;&#xFFFD;&#xFFFD;&apos; is unrecognized or represents more than one time zone</h4>
<p>&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x662F;&#x5728;mysql&#x7684;url&#x53C2;&#x6570;&#x540E;&#x9762;&#x52A0;&#x4E0A;&#x53C2;&#x6570;&#xFF1A;&#x201C;<strong>?serverTimezone=UTC</strong>&#x201D;</p>
<pre><code class="lang-yml"><span class="hljs-attr">spring:</span>
<span class="hljs-attr">  datasource:</span>
<span class="hljs-attr">    url:</span> jdbc:mysql://localhost:<span class="hljs-number">3306</span>/springboot?characterEncoding=utf<span class="hljs-bullet">-8</span>&amp;serverTimezone=UTC
<span class="hljs-attr">    username:</span> root
<span class="hljs-attr">    password:</span> <span class="hljs-number">991568</span>
<span class="hljs-attr">    driver-class-name:</span> com.mysql.cj.jdbc.Driver
</code></pre>
<p>&#x4F46;&#x662F;&#x4E4B;&#x540E;&#x6570;&#x636E;&#x5E93;&#x65F6;&#x95F4;&#x5DEE;&#x4E86;&#x516B;&#x5C0F;&#x65F6;</p>
<p>&#x5C06;UTC&#x6539;&#x6210;Asia/Shanghai</p>
<pre><code>url: jdbc:mysql://localhost:3306/springboot?characterEncoding=utf-8&amp;serverTimezone=Asia/Shanghai
</code></pre><p><strong>UTC&#x4EE3;&#x8868;&#x5168;&#x7403;&#x6807;&#x51C6;&#x65F6;&#x95F4;&#xFF0C;&#x6211;&#x56FD;&#x65F6;&#x95F4;&#x8981;&#x9886;&#x5148;8&#x5C0F;&#x65F6;</strong></p>
<h3 id="&#x914D;&#x7F6E;&#x901A;&#x7528;mapper&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;">&#x914D;&#x7F6E;&#x901A;&#x7528;Mapper(&#x4EE3;&#x7801;&#x751F;&#x6210;&#x5668;)</h3>
<h4 id="at-least-one-base-package-must-be-specified">At least one base package must be specified</h4>
<p>&#x6CA1;&#x6709;&#x626B;&#x63CF;&#x5230;mapper&#x5305;</p>
<p>&#x65B9;&#x5F0F;&#x4E00;&#xFF1A; &#x5728;Mapper&#x63A5;&#x53E3;&#x4E0A;&#x6DFB;&#x52A0;<code>@Mapper</code>&#x6CE8;&#x89E3;</p>
<p>&#x65B9;&#x5F0F;&#x4E8C;&#xFF1A; &#x5728;<code>Application.java</code>&#x542F;&#x52A8;&#x7C7B;&#x4E0A;&#x6DFB;&#x52A0;<code>@MapperScan()</code>&#x6CE8;&#x89E3;&#x626B;&#x63CF;&#x6240;&#x6709;Mapper&#x63A5;&#x53E3;&#x3002;&#x6CE8;&#x610F;&#x8FD9;&#x91CC;&#x7684;<code>@MapperScan</code>&#x6CE8;&#x89E3;&#x6765;&#x81EA;<code>tk.mybatis.spring.annotation.MapperScan</code>&#xFF0C;&#x7528;spring&#x7684;&#x4F1A;&#x62A5;&#x9519;&#x3002;</p>
<p>&#x4E0D;&#x77E5;&#x9053;&#x4E3A;&#x4EC0;&#x4E48;&#xFF0C;&#x65B9;&#x6CD5;&#x4E00;&#x6211;&#x6CA1;&#x6210;&#x529F;</p>
<p>&#x65B9;&#x6CD5;&#x4E8C;</p>
<pre><code class="lang-java"><span class="hljs-meta">@MapperScan</span>(<span class="hljs-string">&quot;top.yll.mapper&quot;</span>)
</code></pre>
<h3 id="&#x89E3;&#x51B3;&#x8DE8;&#x57DF;&#x95EE;&#x9898;">&#x89E3;&#x51B3;&#x8DE8;&#x57DF;&#x95EE;&#x9898;</h3>
<p>&#x6DFB;&#x52A0;@CrossOrigin&#x6CE8;&#x89E3;</p>
<h3 id="&#x52A0;&#x8F7D;yml&#x5931;&#x8D25;">&#x52A0;&#x8F7D;yml&#x5931;&#x8D25;</h3>
<p>&#x5220;&#x9664;&#x5E26;&#x6240;&#x6709;&#x5E26;&#x4E2D;&#x6587;&#x7684;&#x6CE8;&#x91CA;</p>
<h3 id="controller&#x8C03;&#x7528;service&#x62A5;&#x9519;&#x7A7A;&#x6307;&#x9488;&#x5F02;&#x5E38;">controller&#x8C03;&#x7528;service&#x62A5;&#x9519;&#x7A7A;&#x6307;&#x9488;&#x5F02;&#x5E38;</h3>
<p>&#x6211;&#x7684;&#x9519;&#x8BEF;&#x539F;&#x56E0;&#xFF1A; controller&#x5C42;&#x4E2D;&#x7684;service&#x6CA1;&#x6709;&#x6CE8;&#x5165;</p>
<p>&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#xFF1A;&#x52A0;&#x6CE8;&#x89E3;&#xFF08;@Resource @Autowired&#xFF09; </p>
<p>&#x5176;&#x4ED6;&#x539F;&#x56E0;</p>
<p>&#x8C03;&#x7528;controller&#x62A5;&#x7A7A;&#x6307;&#x9488;&#x6709;&#x4E24;&#x79CD;&#x60C5;&#x51B5;&#xFF1A; </p>
<ol>
<li><p>service &#x6216;&#x8005;mapper &#x6CA1;&#x6709;&#x52A0;&#x8F7D;&#x5230;spring&#x5BB9;&#x5668;&#x4E2D; &#xFF0C;&#x5F15;&#x7528;&#x65F6;&#x5019;&#x80AF;&#x5B9A;&#x62A5;&#x7A7A;&#x6307;&#x9488;</p>
</li>
<li><p>service&#x52A0;&#x8F7D;&#x5230;spring&#x5BB9;&#x5668;&#x4E2D;&#x4E86;&#xFF0C; &#x4F46;&#x662F;controller&#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x65B9;&#x6CD5;&#x4E3A;private&#xFF0C;&#x79C1;&#x6709;&#x65B9;&#x6CD5;&#x88AB;&#x63A5;&#x53E3;&#x8BBF;&#x95EE;&#x65F6;&#x5019;&#xFF0C;&#x56E0;&#x4E3A;private&#x4F5C;&#x7528;&#x57DF;&#x7684;&#x95EE;&#x9898;&#xFF0C;&#x65E0;&#x6CD5;&#x83B7;&#x53D6;&#x8BE5;&#x65B9;&#x6CD5;&#xFF0C;&#x62A5;&#x7A7A;&#x6307;&#x9488;</p>
</li>
<li><p>service&#x5C42;&#x6CA1;&#x6709;&#x4F7F;&#x7528;@Service&#x4FEE;&#x9970;(&#x63A5;&#x53E3;&#x4E0D;&#x9700;&#x8981;&#x52A0;&#xFF0C;&#x5728;impl&#x4E2D;&#x52A0;)   </p>
</li>
</ol>
<h3 id="&#x90E8;&#x7F72;&#x76F8;&#x5173;">&#x90E8;&#x7F72;&#x76F8;&#x5173;</h3>
<pre><code class="lang-shell">jps #&#x67E5;&#x770B;Java&#x8FDB;&#x7A0B;
kill -9 &lt;pid&gt; #&#x6740;&#x6B7B;&#x8FDB;&#x7A0B;
taskkill /pid &lt;pid&gt; #Windows&#x547D;&#x4EE4;&#x884C;
nohup java -jar xxx.jar #&#x9000;&#x51FA;&#x547D;&#x4EE4;&#x884C;&#x540E;&#x4ECD;&#x7136;&#x8FD0;&#x884C;
</code></pre>
<h3 id="&#x6570;&#x636E;&#x5E93;&#x7B2C;&#x4E09;&#x6B21;&#x5B9E;&#x9A8C;">&#x6570;&#x636E;&#x5E93;&#x7B2C;&#x4E09;&#x6B21;&#x5B9E;&#x9A8C;</h3>
<h4 id="&#x524D;&#x7AEF;&#x4F20;&#x65E5;&#x671F;&#x5931;&#x8D25;">&#x524D;&#x7AEF;&#x4F20;&#x65E5;&#x671F;&#x5931;&#x8D25;</h4>
<p>input&#x4E2D;&#x4F7F;&#x7528;text&#x4E0D;&#x7528;datetimelocal</p>
<h4 id="&#x65E5;&#x671F;&#x65F6;&#x533A;&#x4E0D;&#x5BF9;&#x5BFC;&#x81F4;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#x5931;&#x8D25;">&#x65E5;&#x671F;&#x65F6;&#x533A;&#x4E0D;&#x5BF9;&#x5BFC;&#x81F4;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#x5931;&#x8D25;</h4>
<pre><code class="lang-Java">date.setHours(date.getHours()-<span class="hljs-number">14</span>);<span class="hljs-comment">//&#x83B7;&#x53D6;&#x65E5;&#x671F;&#x65F6;&#x66F4;&#x6539;&#x76F8;&#x5DEE;&#x7684;&#x65F6;&#x95F4;</span>
</code></pre>
<pre><code class="lang-Java"><span class="hljs-comment">//&#x53E6;</span>
Date date1 = <span class="hljs-keyword">new</span> Date(<span class="hljs-number">2020</span>-<span class="hljs-number">1900</span>, Calendar.JULY,<span class="hljs-number">10</span>,<span class="hljs-number">10</span>,<span class="hljs-number">11</span>,<span class="hljs-number">11</span>);<span class="hljs-comment">//&#x5982;&#x679C;&#x4E0D;-2020&#xFF0C;&#x5E74;&#x4EFD;&#x4E3A;3920</span>
Date date2 = <span class="hljs-keyword">new</span> Date(<span class="hljs-number">2020</span>-<span class="hljs-number">1900</span>, Calendar.JULY,<span class="hljs-number">10</span>,<span class="hljs-number">10</span>,<span class="hljs-number">11</span>,<span class="hljs-number">11</span>);
System.out.println(date1==date2);<span class="hljs-comment">//false</span>
System.out.println(date1.equals(date2));<span class="hljs-comment">//true</span>
</code></pre>
<h4 id="&#x901A;&#x8FC7;session&#x548C;thif&#x9690;&#x85CF;&#x4E00;&#x4E9B;&#x5185;&#x5BB9;">&#x901A;&#x8FC7;Session&#x548C;th:if&#x9690;&#x85CF;&#x4E00;&#x4E9B;&#x5185;&#x5BB9;</h4>
<pre><code class="lang-Java"><span class="hljs-meta">@RequestMapping</span>(<span class="hljs-string">&quot;/login&quot;</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">login</span><span class="hljs-params">(User user, Model model, HttpSession session)</span> </span>{
    <span class="hljs-keyword">if</span> (checkUser(user)) {
        session.setAttribute(<span class="hljs-string">&quot;loginUser&quot;</span>, user.getUsername());
        session.setAttribute(<span class="hljs-string">&quot;userType&quot;</span>, user.getUserType());
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;redirect:/main.html&quot;</span>;
    } <span class="hljs-keyword">else</span> {
        model.addAttribute(<span class="hljs-string">&quot;msg&quot;</span>, <span class="hljs-string">&quot;&#x7528;&#x6237;&#x540D;&#x6216;&#x5BC6;&#x7801;&#x9519;&#x8BEF;&quot;</span>);
        model.addAttribute(<span class="hljs-string">&quot;type&quot;</span>, user.getUserType());
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;login&quot;</span>;
    }
}
</code></pre>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">th</span> <span class="hljs-attr">th:if</span>=<span class="hljs-string">&quot;${session.userType==1}&quot;</span>&gt;</span>&#x64CD;&#x4F5C;<span class="hljs-tag">&lt;/<span class="hljs-name">th</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">style</span>=<span class="hljs-string">&quot;color: red&quot;</span> <span class="hljs-attr">th:text</span>=<span class="hljs-string">&quot;${msg}&quot;</span> <span class="hljs-attr">th:if</span>=<span class="hljs-string">&quot;${not #strings.isEmpty(msg)}&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<h4 id="thymeleaf&#x4F20;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;controller&#x63A5;&#x6536;">Thymeleaf&#x4F20;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;Controller&#x63A5;&#x6536;</h4>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-sm btn-primary&quot;</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">&quot;return confirm(&apos;&#x786E;&#x5B9A;&#x8981;&#x4FEE;&#x6539;&#x5417;&#xFF1F;&apos;)&quot;</span>
  <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;@{/toUpdatePage/{flight_id}/{date}/(flight_id=${flight.getFlight_id()},date=${flight.getDate()})}&quot;</span>&gt;</span>&#x7F16;&#x8F91;<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-sm btn-danger&quot;</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">&quot;return confirm(&apos;&#x786E;&#x5B9A;&#x8981;&#x5220;&#x9664;&#x5417;&#xFF1F;&apos;)&quot;</span>
  <span class="hljs-attr">th:href</span>=<span class="hljs-string">&quot;@{/deleteFlight/{flight_id}/{date}/(flight_id=${flight.getFlight_id()},date=${flight.getDate()})}&quot;</span>&gt;</span>&#x5220;&#x9664;<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</code></pre>
<pre><code class="lang-Java"><span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">&quot;/toUpdatePage/{flight_id}/{date}&quot;</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">toUpdatePage</span><span class="hljs-params">(@PathVariable(<span class="hljs-string">&quot;flight_id&quot;</span>)</span> String flight_id, @<span class="hljs-title">PathVariable</span><span class="hljs-params">(<span class="hljs-string">&quot;date&quot;</span>)</span> Date date) </span>{
}
<span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">&quot;/deleteFlight/{flight_id}/{date}&quot;</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">deleteFlight</span><span class="hljs-params">(@PathVariable(<span class="hljs-string">&quot;flight_id&quot;</span>)</span> String flight_id, @<span class="hljs-title">PathVariable</span><span class="hljs-params">(<span class="hljs-string">&quot;date&quot;</span>)</span> Date date )</span>{
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Springboot">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../vue/" class="navigation navigation-next " aria-label="Next page: Vue">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Springboot一些遇到的问题","level":"1.3.1","depth":2,"next":{"title":"Vue","level":"1.4","depth":1,"path":"vue/README.md","ref":"vue/README.md","articles":[{"title":"Vue+Ssm跨域问题","level":"1.4.1","depth":2,"path":"vue/vue+ssm跨域问题.md","ref":"vue/vue+ssm跨域问题.md","articles":[]},{"title":"Vue Cli3","level":"1.4.2","depth":2,"path":"vue/vue-cli3.md","ref":"vue/vue-cli3.md","articles":[]},{"title":"安装Vue","level":"1.4.3","depth":2,"path":"vue/安装vue.md","ref":"vue/安装vue.md","articles":[]}]},"previous":{"title":"Springboot","level":"1.3","depth":1,"path":"springboot/README.md","ref":"springboot/README.md","articles":[{"title":"Springboot一些遇到的问题","level":"1.3.1","depth":2,"path":"springboot/springboot一些遇到的问题.md","ref":"springboot/springboot一些遇到的问题.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-search","-lunr","-sharing","-anchor-navigation-ex","todo","code","-katex","github","-summary","search-pro","chapter-fold","theme-comscore","toggle-chapters","flexible-alerts"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"github":{"url":"https://github.com/BluePrintYang"},"todo":{},"search-pro":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"showLevel":false,"showGoTop":true,"isRewritePageTitle":true,"isShowTocTitleIcon":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"theme-comscore":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"Attention"},"note":{"className":"info","icon":"fa fa-info-circle","label":"Note"},"style":"callout","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"Tip"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"Warning"}},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{}},"theme":"default","author":"yanglonglong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"My Study Note","language":"zh-hans","links":{"sidebar":{"My Blog":"https://www.yangllong.top/"}},"gitbook":"*"},"file":{"path":"springboot/springboot一些遇到的问题.md","mtime":"2020-06-29T16:04:36.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-14T07:15:50.272Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

